﻿using System;
using System.Collections.Generic;
using Newtonsoft.Json;

namespace Wala.Connection.Objects.Timeline
{
    public class HotPhotoData
    {
        #region //-------------- Private Fields ------------//

        private List<HotPhotoInfo> feed;

        #endregion

        #region //------------- CLR Properties ------------//

        public List<HotPhotoInfo> Feed
        {
            get { return feed; }
            set { feed = value; }
        }

        #endregion

        #region //------------- Public Methods -------------//

        public List<HotPhotoInfo> GetListPhotos()
        {
            List<HotPhotoInfo> lstPhoto = new List<HotPhotoInfo>();
            foreach (HotPhotoInfo hotPhoto in feed)
            {
                if (hotPhoto.Type != 0)
                {
                    lstPhoto.Add(hotPhoto);
                }
            }
            return lstPhoto;
        }

        public static HotPhotoData FromJson(string json)
        {
            HotPhotoData photoData = JsonConvert.DeserializeObject<HotPhotoData>(json);
            return photoData;
        }

        #endregion
    }
}
